package com.opennews.openplatform.familyexpenseapi.controller

import com.opennews.openplatform.familyexpenseapi.service.RegionService
import com.opennews.openplatform.myspringbootcore.dto.ApiResponse
import com.opennews.openplatform.myspringbootcore.util.getSuccessResponse
import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RestController
@RequestMapping("/region")
class RegionController(
    private val regionService: RegionService,
) {
    @GetMapping("/query-all")
    fun queryAll(): ResponseEntity<ApiResponse<List<Map<String, Any>>>> {
        val result = regionService.queryAll()
        return getSuccessResponse(result)
    }
}